//==========================================================================
// Copyright (c) 2000-2006,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __ELASTOS_DISPLAY_H__
#define __ELASTOS_DISPLAY_H__


// Color Format
// If more color formats are added, this enum should be modified.
// NOTE: The current value shouldn't be changed.
#define GPIO_PIN_IN	0
#define GPIO_PIN_OUT	1

#define GPIO_LOW	0
#define GPIO_HIGH	1

#define GPIO_AS_GPIO	0
#define GPIO_AS_AF1	1
#define GPIO_AS_AF2	2
#define GPIO_AS_AF3	3

#define ENABLE_EDGE	0
#define DISABLE_EDGE	1

#define GPIO_EDGE	1
#define GPIO_NOEDGE	0

typedef enum {
    COLOR_RGB565        = 0,
    COLOR_RGBT666       = 1,
    COLOR_RGBT666PACKED = 2,
    COLOR_RGB2          = 3,
    COLOR_RGB4          = 4, // Using palette
    COLOR_RGB8          = 5, // Using palette
    COLOR_RGBT555       = 6,
    COLOR_YCbCr422      = 100,
    COLOR_YCbCr420      = 101
} ColorFormat;

typedef struct {
    ColorFormat Color;
    int Bpp; // Bits per pixel
    int Width;
    int Height;
} FrameBufferFormat;

typedef unsigned long          BOOL;
typedef unsigned               UINT;
typedef unsigned               uint_t;
typedef unsigned               virtaddr_t;
typedef unsigned               physaddr_t;
typedef unsigned long          ulong_t;
#define TRUE 1
#define FALSE 0
#define NULL 0

typedef struct {
    // Match FrameBufferFormat
    ColorFormat Color;
    int Bpp;   // Bits per pixel
    int Width;
    int Height;

    // Special information
    BOOL Enable;   // TRUE: enable overlay2  FALSE: disable overlay2
    int PosX;
    int PosY;
    unsigned short Layer;
    unsigned short Flag;//0 : underlay ; 1 : overlay
    //int Layer;
    // RGB formats only use 1 channel
    // YCbCr(YUV) formats use all 3 channels
    void *pChannelFb[3];
    unsigned int ChannelSize[3];
} OverlayFormat;

#endif //__ELASTOS_DISPLAY_H__
